package com.huike.clues.mapper;



import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huike.common.core.domain.entity.SysDictType;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Description TODO
 * @Author yy
 * @Date 2023-07-11 15:24
 */
@Mapper
public interface SysDictMapper extends BaseMapper<SysDictType> {



    /**
     * 新增字典
     * @param sysDictData
     */
    @Insert("insert into sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark) values (#{dictId},#{dictName},#{dictType},#{status},#{createBy},#{createTime},#{updateBy},#{updateTime},#{remark}) ")
    void addDict(SysDictType sysDictData);

    /**
     * 修改字典
     * @param sysDictData
     */
    void set(SysDictType sysDictData);

    /**
     * 分页查询
     * @return
     */
    List<SysDictType> pageList(SysDictType sysDictType);

    /**
     * 获取字典选择框列表
     *
     * @return
     */
    @Select("select * from sys_dict_type")
    SysDictType optionSelect();


    /**
     * 根据id删除字典
     * @param dictId
     */
    @Delete("delete from sys_dict_type where dict_id=#{dictId}")
    void deleteByDictId(Long dictId);

    /**
     * 根据id回显数据
     * @param dictId
     */
    @Select("select * from sys_dict_type where dict_id=#{dictId}")
    SysDictType findById(Long dictId);

}
